package com.sunwayhorizo.health.business.clinic.emr.emrmanager;

import java.util.List;

import javax.ejb.Local;

import com.sunwayhorizo.health.business.dto.ResultsDTO;
import com.sunwayhorizo.health.business.dto.clinic.emr.emrmanager.EmrManagerDTO;
import com.sunwayhorizo.health.hl7.common.Hl7Exception;
import com.sunwayhorizo.health.hl7.rim.Document;

@Local
public interface EmrManagerLocal {
		
	/**
	 * 开启病历
	 * @param dto
	 * @return
	 * @throws Hl7Exception
	 */
	public Document newEmrManager(EmrManagerDTO dto)throws Hl7Exception;
	
	
	/**
	 * 开启病历状态，组装病历状态动作信息，不做持久化
	 * @param dto
	 * @return
	 * @throws Hl7Exception
	 */
	public Document newEmrManagerNotPersist(EmrManagerDTO dto)throws Hl7Exception;
	
	/**
	 * 病历提交
	 * @param EmrManagerDTO
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO medicalRecordSubmit(EmrManagerDTO dto)throws Hl7Exception;
	
	/**
	 * 病历审核通过
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO medicalRecordComplete(EmrManagerDTO dto)throws Hl7Exception;
	
	/**
	 * 病历打回
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO medicalRecordReturn(EmrManagerDTO dto)throws Hl7Exception;
	
	/**
	 * 病历移出
	 * @return
	 * @throws Hl7Exception
	 */
	public ResultsDTO medicalRecordClean(EmrManagerDTO dto)throws Hl7Exception;
	
	/**
     * 病历召回
     * @param dto
     * @return
     * @throws Hl7Exception
     */
    public ResultsDTO medicalRecordRecall(EmrManagerDTO dto) throws Hl7Exception;
	
	
	/**
	 * 根据患者id拿到病历管理状态
	 * @param patientId 患者角色id
	 * @param patientId 住院次数
	 * @return String
	 * @throws Hl7Exception
	 */
	public String findEmrManagerStatueByPatientId(String patientId,String patientNum) throws Hl7Exception;
	
	/**
	 * 根据患者id，住院次数拿到患者的病历管理动作
	 * @param patientId 患者 RIM 角色id
	 * @param patientNum 患者住院次数
	 * @return Document
	 * @throws Hl7Exception
	 */
	public Document findEmrManagerByPatientId(String patientId,String patientNum) throws Hl7Exception;
	
	/**
	 * 查询员工提交的所有病历
	 * @param empRoleID
	 * @return
	 * @throws Hl7Exception
	 */
	 public List<Document> findSubmitEmrPatientByEmpRoleId(String empRoleID) throws Hl7Exception;
	
	
}
